import javax.swing.*;
import java.awt.event.*;
import java.io.*;
final class CopyItem extends AbstractAction{
  private final Doer frame;
  CopyItem(String name,Doer frame){
    super(name);
    this.frame=frame;
    putValue(SHORT_DESCRIPTION,name);
    String iconFileName="images"+File.separator+name+".gif";
    if(new File(iconFileName).exists())putValue(SMALL_ICON,new ImageIcon(iconFileName));
  }
  public void actionPerformed(ActionEvent e){
    copyFile();
  }
  public void copyFile(){
    InterWindow interWindow=(InterWindow)frame.getTab().getComponentAt(frame.getSelect());
    interWindow.getTextArea().copy();
  }
}
